package com.tanhua.autoconfig.properties;

import com.baidu.aip.face.AipFace;
import com.tanhua.autoconfig.template.FaceTemplate;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;

import java.io.File;

/**
 * @author げっしょく
 * @date 2021/10/23
 */
@Data
@ConfigurationProperties("tanhua.aip")
public class FaceProperties {
    private String appId;
    private String apiKey;
    private String secretKey;

    @Bean
    public AipFace aipFace() {
        AipFace aipFace = new AipFace(appId, apiKey, secretKey);

        // 可选：设置网络连接参数
        aipFace.setConnectionTimeoutInMillis(2000);
        aipFace.setSocketTimeoutInMillis(60000);
        return aipFace;
    }

}
